package com.tianji.promotion.mapper;

import com.tianji.promotion.domain.po.Coupon;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * 优惠券的规则信息 Mapper 接口
 * </p>
 *
 * @author wxh
 * @since 2024-09-01
 */
public interface CouponMapper extends BaseMapper<Coupon> {

    /**
     * 修改优惠券库存
     *
     * @param couponId 优惠券id
     */
    @Update("update coupon set issue_num = issue_num +1 where  id = #{couponId}")
    void updateCouponCount(@Param("couponId") Long couponId);
}
